Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[System] Fix TCP socket reuse. #2047

Merged
merged 3 commits into from Sep 17, 2015
Merged

[System] Fix TCP socket reuse. #2047

merged 3 commits into from Sep 17, 2015

Conversation

esdrubal
Copy link
Contributor

TCP sockets with option SocketOptionName.ReuseAddress were not working on Linux.

Fixes #31557.

Test checks that when setting TCP socket option ReuseAddress, it is
possible to bind other sockets to the same endpoint.

Covers #31557.
TCP sockets with option SocketOptionName.ReuseAddress were not working on Linux.

Fixes #31557.
@esdrubal esdrubal force-pushed the socketreuse branch 2 times, most recently from 4a12a03 to 79d28a7 Compare September 14, 2015 09:47
@stefansedich
Copy link
Contributor

Interesting @esdrubal the double bind tests failed on this one, when I did this fix during my experimenting it seemed to work fine, any ideas?

@esdrubal
Copy link
Contributor Author

@stefansedich it should work but it seems Jenkins is using a Linux distribution that doesn't support SO_REUSEPORT.

It should work when grep -r SO_REUSEPORT /usr/include/ finds something.
@directhex do our Jenkins distros support SO_REUSEPORT?

@akoeplinger
Copy link
Member

@esdrubal SO_REUSEPORT was only added in the Linux 3.9 kernel, most of the Jenkins workers use Debian 7 with 3.2 kernel. Is there a way to check and skip the test if the flag is not there?

Multiple threads listening to the same address and port are not possible
before linux 3.9 kernel, where the socket option SO_REUSEPORT was
introduced.

This commit makes TcpDoubleBind sensible to this OS capability.
esdrubal added a commit that referenced this pull request Sep 17, 2015
[System] Fix TCP socket reuse.
@esdrubal esdrubal merged commit 07bae96 into mono:master Sep 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants